<template>
  <div class="cell">
    <van-cell
      title="领用"
      is-link
      to="/apply/Ly1"
      class="cell"
    />
    <van-cell
      is-link
      title="退库"
      @click="show = true"
      class="cell"
    />
    <van-action-sheet
      v-model="show"
      :actions="actions"
      cancel-text="取消"
      @select="onSelect"
    />
    <van-cell
      title="维修"
      is-link
      to=""
      class="cell"
    />
    <van-cell
      title="报废"
      is-link
      to=""
      class="cell"
    />
  </div>
  <!-- <div>
  <van-button type="default" @click="$router.push({name:'first'})" block>领用</van-button>
  <van-button type="default" block>退库</van-button>
  <van-button type="default" block>维修</van-button>
  <van-button type="default" block>报废</van-button>
</div> -->

</template>

<script>
export default {
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      active: 0,
      show: false,
      actions: [{ name: '领用退库', value: 0 }, { name: '下线退库', value: 1 }],
    }
  },
  methods: {
    onSelect (item) {
      // 默认情况下点击选项时不会自动收起
      // 可以通过 close-on-click-action 属性开启自动收起
      this.show = false;
      if (item.value == 0) {
        this.$router.push('/lytk')

      } else {
        this.$router.push('/xxtk')
      }

    },
  }
}
</script>

<style>
</style>